<template>
  <div>
    <el-table
      class="el_table_bg"
      :data="tData"
      stripe
      border
      :header-cell-style="biaotou_yangshi"
      :cell-style="liebiao_yangshi"
    >
      <el-table-column
        v-for="(v, index) in tHead"
        :key="index"
        :prop="v.field"
        :label="v.title"
        :min-width="130"
        :width="v.width"
        ref="thDom"
      >
        <template slot-scope="scope">
          <span>{{ scope.row[v.field] }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="180">
        <template slot-scope="scope">
          <div class="order_name">
            <el-button
              v-if="!scope.row.isDel"
              size="mini"
              @click="editFun(scope.row)"
              >编辑</el-button
            >
            <el-button
              v-if="scope.row.isDel"
              size="mini"
              @click="detailFun(scope.row)"
              >详情</el-button
            >
            <el-button size="mini" @click="deleteFun(scope.row)"
              >删除</el-button
            >
          </div>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import {
  findOfflineFile,
  findFileByFileName,
  upload,
  deleteOfflineFileById,
  getall_options,
  getall_optionss,
} from "@/api/testRequest";
export default {
  props: {
    tData: {
      type: Array,
      default() {
        return {};
      },
    },
    tHead: {
      type: Array,
      default() {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  methods: {
    liebiao_yangshi() {
      return "text-align:center;color:#333333;font-size:14px;";
    },
    biaotou_yangshi() {
      return "text-align:center;background:#f1f6ff;color:#333333;font-size:14px";
    },
    // 编辑
    editFun(msg) {
      this.$emit("editMsg", msg);
    },
    //删除
    deleteFun(msg) {
      this.$emit("deleteFun", msg);
    },
    // 详情
    detailFun(msg) {
      // msg.business = '['+msg.business+']'
      this.$emit("detailFun", msg);
    },
  },
};
</script>